import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";

@Entity("charging_card", { schema: "charge" })
export class ChargingCard {
  @PrimaryGeneratedColumn({ type: "int", name: "id", unsigned: true })
  id: number;

  @Column("int", {
    name: "user_id",
    comment: "用户",
    unsigned: true,
    default: () => "'0'",
  })
  userId: number;

  @Column("varchar", { name: "card_no", comment: "卡号", length: 20 })
  cardNo: string;

  @Column("tinyint", {
    name: "status",
    comment: "0：未激活，1:激活",
    default: () => "'0'",
  })
  status: number;

  @Column("decimal", {
    name: "amount",
    precision: 6,
    scale: 2,
    default: () => "'0.00'",
  })
  amount: string;

  @Column("decimal", {
    name: "reward_amount",
    precision: 6,
    scale: 2,
    default: () => "'0.00'",
  })
  rewardAmount: string;

  @Column("decimal", {
    name: "freeze_amount",
    precision: 6,
    scale: 2,
    default: () => "'0.00'",
  })
  freezeAmount: string;

  @Column("varchar", { name: "remark", comment: "备注", length: 100 })
  remark: string;

  @Column("int", {
    name: "active_time",
    comment: "结束时间",
    unsigned: true,
    default: () => "'0'",
  })
  activeTime: number;

  @Column("int", {
    name: "create_time",
    comment: "结束时间",
    unsigned: true,
    default: () => "'0'",
  })
  createTime: number;
}
